package com.dmgis.qxfw.dataservice.businessservice.prosrv.controller;

import com.dmgis.qxfw.dataservice.businessservice.api.entity.xt.sys_config;
import com.dmgis.qxfw.dataservice.businessservice.prosrv.service.IProsrvService;
import com.dmgis.qxfw.dataservice.pages.interceptor.LoginInterceptor;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.util.List;

@Controller
@RequestMapping("/prosrv")
public class ProsrvController {
	@Resource
	private IProsrvService iprosrvService;


	/* 获得路径 */
	@RequestMapping("/getUrl")
	@ResponseBody
	public Object getUrl(HttpServletRequest request, HttpServletResponse   response  ,Model model) {
		LoginInterceptor loginInterceptor = new LoginInterceptor();
		sys_config selectKey = new sys_config();// 查询类
		HttpSession session = request.getSession();
		Object userName = session.getAttribute("userName");
		if (userName==""||userName==null){
			return "redirect:login.jsp";
		}
		String name = request.getParameter("name");//
		selectKey.setParamname(name);
		List<sys_config> resultList = iprosrvService.getUrl(selectKey); // 结果
		return resultList;

	}
}
